home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / mymem1 / myset.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  1995-05-08  |  13.6 KB  |  469 lines

  1. VERSION 2.00
  2. Begin Form Myset 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Settings"
  5.    ClientHeight    =   3375
  6.    ClientLeft      =   1095
  7.    ClientTop       =   1485
  8.    ClientWidth     =   5895
  9.    Height          =   3780
  10.    Icon            =   0
  11.    Left            =   1035
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3375
  17.    ScaleWidth      =   5895
  18.    Top             =   1140
  19.    Width           =   6015
  20.    Begin Frame FrameSave 
  21.       Caption         =   "Save Settings to:"
  22.       Height          =   975
  23.       Left            =   120
  24.       TabIndex        =   28
  25.       Top             =   2280
  26.       Width           =   5655
  27.       Begin OptionButton OptionSaveWEP 
  28.          Caption         =   "Save to ENTPACK.INI"
  29.          Height          =   255
  30.          Left            =   3000
  31.          TabIndex        =   23
  32.          Top             =   600
  33.          Width           =   2295
  34.       End
  35.       Begin OptionButton OptionSaveMy 
  36.          Caption         =   "Save to MyMemory.INI"
  37.          Height          =   255
  38.          Left            =   120
  39.          TabIndex        =   21
  40.          Top             =   600
  41.          Width           =   2295
  42.       End
  43.       Begin OptionButton OptionSaveWIN 
  44.          Caption         =   "Save to WIN.INI"
  45.          Height          =   255
  46.          Left            =   3000
  47.          TabIndex        =   22
  48.          Top             =   240
  49.          Width           =   1935
  50.       End
  51.       Begin OptionButton OptionSaveNo 
  52.          Caption         =   "Don't Save"
  53.          Height          =   255
  54.          Left            =   120
  55.          TabIndex        =   20
  56.          Top             =   240
  57.          Width           =   2295
  58.       End
  59.    End
  60.    Begin CheckBox CheckScore 
  61.       Caption         =   "Save Best Score"
  62.       Height          =   255
  63.       Left            =   3960
  64.       TabIndex        =   19
  65.       Top             =   1800
  66.       Width           =   1935
  67.    End
  68.    Begin Frame FrameTime 
  69.       Caption         =   "Unmatched Pairs Stay Visible (seconds)"
  70.       Height          =   615
  71.       Left            =   120
  72.       TabIndex        =   27
  73.       Top             =   1560
  74.       Width           =   3735
  75.       Begin OptionButton OptionS5 
  76.          Caption         =   " 5"
  77.          Height          =   255
  78.          Left            =   3000
  79.          TabIndex        =   18
  80.          Top             =   240
  81.          Width           =   495
  82.       End
  83.       Begin OptionButton OptionS4 
  84.          Caption         =   " 4"
  85.          Height          =   255
  86.          Left            =   2280
  87.          TabIndex        =   17
  88.          Top             =   240
  89.          Width           =   495
  90.       End
  91.       Begin OptionButton OptionS3 
  92.          Caption         =   " 3"
  93.          Height          =   255
  94.          Left            =   1560
  95.          TabIndex        =   16
  96.          Top             =   240
  97.          Width           =   495
  98.       End
  99.       Begin OptionButton OptionS2 
  100.          Caption         =   " 2"
  101.          Height          =   255
  102.          Left            =   840
  103.          TabIndex        =   15
  104.          Top             =   240
  105.          Width           =   495
  106.       End
  107.       Begin OptionButton OptionS1 
  108.          Caption         =   " 1"
  109.          Height          =   255
  110.          Left            =   120
  111.          TabIndex        =   14
  112.          Top             =   240
  113.          Width           =   495
  114.       End
  115.    End
  116.    Begin CommandButton CmdCancel 
  117.       Caption         =   "Cancel"
  118.       Height          =   495
  119.       Left            =   4800
  120.       TabIndex        =   1
  121.       Top             =   960
  122.       Width           =   855
  123.    End
  124.    Begin Frame FrameSquare 
  125.       Caption         =   "Square Size (pixels)"
  126.       Height          =   615
  127.       Left            =   2280
  128.       TabIndex        =   26
  129.       Top             =   840
  130.       Width           =   2295
  131.       Begin OptionButton OptionP48 
  132.          Caption         =   "48"
  133.          Height          =   255
  134.          Left            =   1560
  135.          TabIndex        =   13
  136.          Top             =   240
  137.          Width           =   615
  138.       End
  139.       Begin OptionButton OptionP40 
  140.          Caption         =   "40"
  141.          Height          =   255
  142.          Left            =   840
  143.          TabIndex        =   12
  144.          Top             =   240
  145.          Width           =   615
  146.       End
  147.       Begin OptionButton OptionP32 
  148.          Caption         =   "32"
  149.          Height          =   255
  150.          Left            =   120
  151.          TabIndex        =   11
  152.          Top             =   240
  153.          Width           =   615
  154.       End
  155.    End
  156.    Begin Frame FrameY 
  157.       Caption         =   "Vertical Squares"
  158.       Height          =   615
  159.       Left            =   120
  160.       TabIndex        =   25
  161.       Top             =   840
  162.       Width           =   2175
  163.       Begin OptionButton OptionV10 
  164.          Caption         =   "10"
  165.          Height          =   255
  166.          Left            =   1560
  167.          TabIndex        =   10
  168.          Top             =   240
  169.          Width           =   495
  170.       End
  171.       Begin OptionButton OptionV8 
  172.          Caption         =   " 8"
  173.          Height          =   255
  174.          Left            =   840
  175.          TabIndex        =   9
  176.          Top             =   240
  177.          Width           =   495
  178.       End
  179.       Begin OptionButton OptionV6 
  180.          Caption         =   " 6"
  181.          Height          =   255
  182.          Left            =   120
  183.          TabIndex        =   8
  184.          Top             =   240
  185.          Width           =   495
  186.       End
  187.    End
  188.    Begin CommandButton CmdOK 
  189.       Caption         =   "OK"
  190.       Default         =   -1  'True
  191.       Height          =   495
  192.       Left            =   4800
  193.       TabIndex        =   0
  194.       Top             =   240
  195.       Width           =   855
  196.    End
  197.    Begin Frame FrameX 
  198.       Caption         =   "Horizontal Squares"
  199.       Height          =   615
  200.       Left            =   120
  201.       TabIndex        =   24
  202.       Top             =   120
  203.       Width           =   4455
  204.       Begin OptionButton OptionH18 
  205.          Caption         =   "18"
  206.          Height          =   255
  207.          Left            =   3720
  208.          TabIndex        =   7
  209.          Top             =   240
  210.          Width           =   615
  211.       End
  212.       Begin OptionButton OptionH16 
  213.          Caption         =   "16"
  214.          Height          =   255
  215.          Left            =   3000
  216.          TabIndex        =   6
  217.          Top             =   240
  218.          Width           =   615
  219.       End
  220.       Begin OptionButton OptionH14 
  221.          Caption         =   "14"
  222.          Height          =   255
  223.          Left            =   2280
  224.          TabIndex        =   5
  225.          Top             =   240
  226.          Width           =   615
  227.       End
  228.       Begin OptionButton OptionH12 
  229.          Caption         =   "12"
  230.          Height          =   255
  231.          Left            =   1560
  232.          TabIndex        =   4
  233.          Top             =   240
  234.          Width           =   615
  235.       End
  236.       Begin OptionButton OptionH10 
  237.          Caption         =   "10"
  238.          Height          =   255
  239.          Left            =   840
  240.          TabIndex        =   3
  241.          Top             =   240
  242.          Width           =   615
  243.       End
  244.       Begin OptionButton OptionH8 
  245.          Caption         =   " 8"
  246.          Height          =   255
  247.          Left            =   120
  248.          TabIndex        =   2
  249.          Top             =   240
  250.          Width           =   615
  251.       End
  252.    End
  253. Dim TempX As Integer
  254. Dim TempY As Integer
  255. Dim TempTime As Single
  256. Dim TempFile As Integer
  257. Dim TempScore As Integer
  258. Dim TempSquare As Integer
  259. Sub CheckScore_Click ()
  260.     TempScore = CheckScore.Value
  261. End Sub
  262. Sub CmdCancel_Click ()
  263.     Unload MySet
  264. End Sub
  265. Sub CmdOK_Click ()
  266. 'Hide Form first so we don't paint screen twice
  267. '    MySet.Hide
  268. 'Tell player to wait
  269.     MousePointer = HOURGLASS
  270. 'One or Both X and Y Values may have changed
  271.     If (TempX <> NumberXSquares) Or (TempY <> NumberYSquares) Or (TempSquare <> SquareSize) Then
  272.     'see if X size has changed
  273.         If TempX <> 0 Then NumberXSquares = TempX
  274.     'See if Y has changed
  275.         If TempY <> 0 Then NumberYSquares = TempY
  276.     'See if Square size has changed
  277.         If TempSquare <> SquareSize Then SquareSize = TempSquare
  278.     'redimension the arrays
  279.         ReDim SquareStatusArray(NumberXSquares, NumberYSquares)
  280.         ReDim SquareSceneArray(NumberXSquares, NumberYSquares)
  281.     'Resize form
  282.         ResizeMyMemoryForm
  283.     'Initialize Field and display
  284.         InitField
  285.     'Indicate Setup has Changed
  286.         SaveFileChange = True
  287.     End If
  288. 'see if timer value has changed
  289.     If TempTime <> SetTimer Then
  290.         SetTimer = TempTime
  291.         SaveFileChange = True
  292.     End If
  293. 'see if ini file has changed
  294.     If TempFile <> SaveFile Then
  295.         SaveFile = TempFile
  296.         SaveFileChange = True
  297.         If SaveFile = SelectSaveFileMy Then
  298.             IniFile = SelectMy
  299.         ElseIf SaveFile = SelectSaveFileWEP Then
  300.             IniFile = SelectWEP
  301.         ElseIf SaveFile = SelectSaveFileWIN Then
  302.             IniFile = SelectWIN
  303.         Else
  304.             IniFile = ""
  305.         End If
  306.     End If
  307. 'Indicate change to save score
  308.     If TempScore <> SaveScore Then
  309.         SaveScore = TempScore
  310.         SaveFileChange = True
  311.     End If
  312. 'done
  313.     MousePointer = DEFAULT
  314.     Unload MySet
  315. End Sub
  316. Sub OptionH10_Click ()
  317.     TempX = 10
  318.     ReCheckValidY
  319. End Sub
  320. Sub OptionH12_Click ()
  321.     TempX = 12
  322.     ReCheckValidY
  323. End Sub
  324. Sub OptionH14_Click ()
  325.     TempX = 14
  326.     ReCheckValidY
  327. End Sub
  328. Sub OptionH16_Click ()
  329.     TempX = 16
  330.     ReCheckValidY
  331. End Sub
  332. Sub OptionH18_Click ()
  333.     TempX = 18
  334.     ReCheckValidY
  335. End Sub
  336. Sub OptionH8_Click ()
  337.     TempX = 8
  338.     ReCheckValidY
  339. End Sub
  340. Sub OptionP32_Click ()
  341.     TempSquare = 32
  342.     ReCheckValid
  343. End Sub
  344. Sub OptionP40_Click ()
  345.     TempSquare = 40
  346.     ReCheckValid
  347. End Sub
  348. Sub OptionP48_Click ()
  349.     TempSquare = 48
  350.     ReCheckValid
  351. End Sub
  352. Sub OptionS1_Click ()
  353.     TempTime = 1
  354. End Sub
  355. Sub OptionS2_Click ()
  356.     TempTime = 2
  357. End Sub
  358. Sub OptionS3_Click ()
  359.     TempTime = 3
  360. End Sub
  361. Sub OptionS4_Click ()
  362.     TempTime = 4
  363. End Sub
  364. Sub OptionS5_Click ()
  365.     TempTime = 5
  366. End Sub
  367. Sub OptionSaveMy_Click ()
  368.     TempFile = SelectSaveFileMy
  369.     CheckScore.Enabled = True
  370.     CheckScore.Value = CHECKED
  371.     TempScore = CHECKED
  372. End Sub
  373. Sub OptionSaveNo_Click ()
  374.     TempFile = SelectSaveFileNo
  375.     CheckScore.Enabled = False
  376.     CheckScore.Value = UNCHECKED
  377.     TempScore = UNCHECKED
  378. End Sub
  379. Sub OptionSaveWEP_Click ()
  380.     TempFile = SelectSaveFileWEP
  381.     CheckScore.Enabled = True
  382.     CheckScore.Value = CHECKED
  383.     TempScore = CHECKED
  384. End Sub
  385. Sub OptionSaveWIN_Click ()
  386.     TempFile = SelectSaveFileWIN
  387.     CheckScore.Enabled = True
  388.     CheckScore.Value = CHECKED
  389.     TempScore = CHECKED
  390. End Sub
  391. Sub OptionV10_Click ()
  392.     TempY = 10
  393. End Sub
  394. Sub OptionV6_Click ()
  395.     TempY = 6
  396. End Sub
  397. Sub OptionV8_Click ()
  398.     TempY = 8
  399. End Sub
  400. Sub ReCheckValid ()
  401. 'recheck X values to see which are valid with square size
  402.     'Check option for 18 squares across
  403.     If TempSquare * 18 < ScreenPixelSizeX Then
  404.         OptionH18.Enabled = True
  405.     Else
  406.         'If item selected reduce to next lower selection
  407.         If OptionH18.Value = True Then
  408.             OptionH18.Value = False
  409.             OptionH16.Value = True
  410.         End If
  411.         OptionH18.Enabled = False
  412.     End If
  413.     'Check option for 16 squares across
  414.     If TempSquare * 16 < ScreenPixelSizeX Then
  415.         OptionH16.Enabled = True
  416.     Else
  417.         'If item selected reduce to next lower selection
  418.         If OptionH16.Value = True Then
  419.             OptionH16.Value = False
  420.             OptionH14.Value = True
  421.         End If
  422.         OptionH16.Enabled = False
  423.     End If
  424.     'Check option for 14 squares across
  425.     If TempSquare * 14 < ScreenPixelSizeX Then
  426.         OptionH14.Enabled = True
  427.     Else
  428.         'If item selected reduce to next lower selection
  429.         If OptionH14.Value = True Then
  430.             OptionH14.Value = False
  431.             OptionH12.Value = True
  432.         End If
  433.         OptionH14.Enabled = False
  434.     End If
  435. 'this routine assumes minimum X pixel size of 640
  436. 'so it doesn't check options using less than 14 squares across
  437. '( 12 * 48 = 576 which is less than 640)
  438.     ReCheckValidY
  439. End Sub
  440. Sub ReCheckValidY ()
  441.     If (TempX = 0 And NumberXSquares < 12) Or TempX = 8 Or TempX = 10 Then
  442.         FieldY% = (FormLabel * 3) + (FormHeader / TwipsPerPixel)
  443.     Else
  444.         FieldY% = (FormLabel * 2) + (FormHeader / TwipsPerPixel)
  445.     End If
  446.     'Check option for 10 squares down
  447.     If TempSquare * 10 + FieldY% < ScreenPixelSizeY Then
  448.         OptionV10.Enabled = True
  449.     Else
  450.         'If item selected reduce to next lower selection
  451.         If OptionV10.Value = True Then
  452.             OptionV10.Value = False
  453.             OptionV8.Value = True
  454.         End If
  455.         OptionV10.Enabled = False
  456.     End If
  457.     'Check option for 8 squares down
  458.     If TempSquare * 8 + FieldY% < ScreenPixelSizeY Then
  459.         OptionV8.Enabled = True
  460.     Else
  461.         'If item selected reduce to next lower selection
  462.         If OptionV8.Value = True Then
  463.             OptionV8.Value = False
  464.             OptionV6.Value = True
  465.         End If
  466.         OptionV8.Enabled = False
  467.     End If
  468. End Sub
  469.